<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>VUE学习 - params数据请求</title>
</head>

<body>


  <!--载入vue.js-->
  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

  <div id="Application">

    您的名字是：{{data.name}} <br />
    您的ID是：{{data.id}}

  </div>
  <script>
    const app = Vue.createApp({
      setup() {
        const data = Vue.ref("");
        axios.get('https://rouse.npc.ink/api/data.php', {
          params: {
            list: 1
          }
        })
          .then(response => {
            console.log(response)
            data.value = response.data;
          })

        return { data };

      },
    })

    app.mount("#Application")
  </script>

</body>

</html>